home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / AMOSList / AMOSLIST.0997 / 000169_amos-request@svcs1.digex.net_Thu Sep 18 19:04:44 1997.msg < prev    next >
Text File  |  1997-10-01  |  3KB  |  75 lines

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail3.access.digex.net (8.8.5/8.8.5) with ESMTP id TAA22489
  3.     for <mcox@access.digex.net>; Thu, 18 Sep 1997 19:04:43 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id QAA22917
  6.     for amos-out; Thu, 18 Sep 1997 16:24:10 -0400 (EDT)
  7. Received: from mail3.access.digex.net (mail3.access.digex.net [205.197.247.4])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id QAA22914
  9.     for <amos-list@svcs1.digex.net>; Thu, 18 Sep 1997 16:24:10 -0400 (EDT)
  10. Received: from red.paston.co.uk (red.paston.co.uk [194.129.188.3])
  11.     by mail3.access.digex.net (8.8.5/8.8.5) with ESMTP id QAA02007
  12.     for <amos-list@access.digex.net>; Thu, 18 Sep 1997 16:24:06 -0400 (EDT)
  13. Received: from paston.co.uk ([194.129.188.201]) by red.paston.co.uk with SMTP id <843383-442> convert rfc822-to-8bit; Thu, 18 Sep 1997 21:19:47 +0100
  14. From: Ben Wyatt <bwyatt@paston.co.uk>
  15. To: Jamie Bentley <sniper@technet2000.com.au>,
  16.         AMOS Mailing List <amos-list@access.digex.net>
  17. Date:     Thu, 18 Sep 1997 00:00:21 -0000
  18. Message-ID: <yam7200.1078.4584432@194.129.188.3>
  19. In-Reply-To: <yam7199.814.270870024@marvin.technet2000.com.au>
  20. X-Mailer: YAM 1.3.4 [020] - Amiga Mailer by Marcel Beck
  21. Subject: Re: I need HELP
  22. MIME-Version: 1.0
  23. Content-Type: text/plain; charset=iso-8859-1
  24. Content-Transfer-Encoding: 8BIT
  25. Status: O
  26. X-Status: 
  27.  
  28. On 16-Sep-97, Jamie Bentley sat on a keyboard and produced this mess:
  29.  
  30. >  I'm making a Lemmings clone, and I've got to make the lemming BOBS trace the ground, so they appear to be walking on it, the ground is NOT a bob, and is a background (basicly I PASTE bobs to it, so its more or less an IFF picture).
  31.  
  32. >  Does anybody know a sort of easy way I can have a lemmings walk up and down along the ground, and if he comes up to a wall (about 6 pixels high) turns around?
  33.  
  34. Yep, it's quite easy to do. Assuming the hot-spot of the lemming is at the
  35. bottom of him you can do this for walking right - it's something similar
  36. for walking left...
  37.  
  38.    If Point(x+1,y-6)=0
  39.       ' x+1 - for next pixel
  40.       ' y-6 - to check if wall to the right is too high
  41.       ' =0  - 0 is background colour
  42.  
  43.       ' Isn't too steep, so he can move right
  44.       Inc x
  45.  
  46.       ' Now we have to find out how steep the land is...
  47.       If Point(x,y-1)=0
  48.          ' Check at ground level first because it's the most likely case
  49.          ' Here we don't need to move him up at all because the land is
  50.          ' flat or slops down - if it slops down, he can fall down when he
  51.          ' next gets updated.
  52.  
  53.       Else If Point(x,y-2)=0
  54.          ' Now he has to move up one pixel
  55.          Dec y
  56.  
  57.       Else If Point(x,y-3)=0
  58.          ' Moves up two pixels
  59.          Add y,-2
  60.  
  61.       Else If etc - Could do this with a loop but it may be slightly slower
  62.       End If
  63.  
  64.    Else : Rem Must have hit a wall
  65.       ' Change direction
  66.    End If
  67.  
  68. I hope that helps.
  69.  
  70. Bye ____________________________________________________
  71.    /                                                    \
  72.   / Ben Wyatt - bwyatt@paston.co.uk or b.wyatt@uea.ac.uk \
  73.   \   http://www.paston.co.uk/users/bwyatt/index.html    /
  74.    \____________________________________________________/
  75.         (c)1995-97 Very Interesting Signatures Ltd.